#ifndef __THREADPOOL_H__
#define __THREADPOOL_H__

#include "taskQueue.h"
#include "train.h"

// 线程池属性
typedef struct threadPool_s{
    pthread_t *tidArr;
    int threadnum;
    taskQueue_t taskQueue; // 初始化任务队列
    int exitFlag;          // 任务标志
    train_t train;         // 信息传输协议
}threadPool_t;


void *workerThreadFunc(void *arg);
int threadPoolInit(threadPool_t *threadPool, int workernum);
int makeWorker(threadPool_t *threadPool);
int tcpInit(const char *ip, const char *port, int *psockfd);
int epollAdd(int epfd, int fd);
int epollDel(int epfd, int fd);
int transFile(int netfd);
int workerExecute(train_t* train, userInfo* info);

#endif
